<!doctype html>
[#escape x as (x)!?html]
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <title>${content.title} - ${site.seoTitle} - Powered by JPROCMS</title>
  <meta name="keywords" content="${content.keywords!site.seoKey}">
  <meta name="description" content="${content.description!site.seoDesc}">
  [#include '../includes/common_res.html'/]
</head>
<body>
[#if config.grade>1&&!dynamic]
  <!--# include file="/${site.sitePathPrefix}/includes/header.html" -->
[#else]
  [#include '../includes/header.html'/]
[/#if]
<div class="bg-gray-200">
  <div class="container">
    <nav class="row" aria-label="breadcrumb">
      <ol class="col list-inline my-2">
        <li class="list-inline-item"><a href="${site.url}">首页</a></li>
        [#list channel.nodeList as c]
          <li class="list-inline-item">></li>
          <li class="list-inline-item">[@ZUrl object=c/]</li>
        [/#list]
      </ol>
    </nav>
  </div>
</div>
<div class="container">
  <div class="row">
    <div class="col-md-4 mt-4">
      <img class="img-fluid img-thumbnail" src="${content.sysImage}" alt="">
    </div>
    <div class="col-md-8 mt-4">
      <h5 class="common-ff-yh">${content.title}</h5>
      <div class="mt-3 pb-3 border-bottom text-muted">
        <span>${ZFormat(content.releaseTime, 'yyyy-MM-dd HH:mm:ss')}</span>
        <i class="ml-2 far fa-eye"></i> <span id="views"></span>
        <script>
          axios.get('${api}/content/view/${content.id?c}').then(function (response) {
            $('#views').text(response.data.data);
          });
        </script>
      </div>
      <div class="clearfix">
        <div class="float-left w-50 mt-3"><span class="text-muted mr-2">软件语言：</span>${content.customs['lang']}</div>
        <div class="float-left w-50 mt-3"><span class="text-muted mr-2">授权方式：</span>${content.customs['sqfs']}</div>
        <div class="float-left w-50 mt-3"><span class="text-muted mr-2">运行环境：</span>${content.customs['env']!?join(", ")}</div>
        <div class="float-left w-50 mt-3"><span class="text-muted mr-2">软件大小：</span>${content.sysAttachFileSizeStr}</div>
        <div class="float-left w-50 mt-3"><span class="text-muted mr-2">发布时间：</span>${ZFormat(content.releaseTime, 'yyyy-MM-dd')}</div>
        <div class="float-left w-50 mt-3"><span class="text-muted mr-2">下载次数：</span><span id="downloads" class="text-danger"></span> 次</div>
      </div>
      <a id="contentDown" class="mt-3 p-2 rounded h3 d-inline-block bg-primary text-white text-decoration-none">
        <i class="fas fa-download"></i> 立即下载
      </a>
      <script>
        axios.get('${api}/content/download-getkey/${content.id?c}').then(function (response) {
          $('#contentDown').attr('href', '${api}/content/download/file/get/${content.id?c}?' + response.data.data);
        })
      </script>
      <div class="lead d-flex text-danger">
        <div class="common-pointer" onclick="contentUp()"><i class="far fa-thumbs-up"></i> <span id="ups"></span></div>
        <div class="common-pointer ml-4" onclick="contentDown()"><i class="far fa-thumbs-down"></i> <span id="downs"></span></div>
      </div>
      <script>
        function contentUp() {
          axios.post('${api}/content/up/${content.id?c}').then(function (response) {
            if (response.data.data <= 0) {
              alert("您已经点赞过了！");
              return;
            }
            $('#ups').text(response.data.data);
          });
        }

        function contentDown() {
          axios.post('${api}/content/down/${content.id?c}').then(function (response) {
            if (response.data.data <= 0) {
              alert("您已经踩过了！");
              return;
            }
            $('#downs').text(response.data.data);
          });
        }

        axios.get('${api}/content/count/${content.id?c}').then(function (response) {
          $('#ups').text(response.data.data.ups);
          $('#downs').text(response.data.data.downs);
          $('#downloads').text(response.data.data.downloads);
        });
      </script>
    </div>
  </div>
  <div class="row mt-3">
    <div class="col">
      <h5 class="mt-2 border-bottom"><span class="common-block-head-bottom">软件介绍</span></h5>
      <div class="article-content">[#noescape]${content.text!}[/#noescape]</div>
      <script>$('.article-content img').addClass('img-fluid');</script>
      <ul class="border-top list-unstyled mt-3 pt-3">
        [@ZContentSide id=content.id releaseTime=content.releaseTime topLevel=content.topLevel channelId=content.channelId next=false; c]
          <li class="text-truncate mt-2">
            <strong>上一篇：</strong>[#if c??][@ZUrl object=c class="common-link"/][#else]没有了[/#if]
          </li>
        [/@ZContentSide]
        [@ZContentSide id=content.id releaseTime=content.releaseTime topLevel=content.topLevel channelId=content.channelId next=true; c]
          <li class="text-truncate mt-2">
            <strong>下一篇：</strong>[#if c??][@ZUrl object=c class="common-link"/][#else]没有了[/#if]
          </li>
        [/@ZContentSide]
      </ul>
      <h5 class="mt-4 border-bottom"><span class="common-block-head-bottom">相关新闻</span></h5>
      [@ZContentRelateList contentId=content.id  count=5; list]
        <ul class="list-unstyled mt-3">
          [#list list as c]
            <li class="text-truncate mt-2">[@ZUrl object=c class="common-link"/]</li>
          [/#list]
        </ul>
      [/@ZContentRelateList]
    </div>
  </div>
</div>
[#if config.grade>1&&!dynamic]
    <!--# include file="/${site.sitePathPrefix}/includes/footer.html" -->
[#else]
    [#include '../includes/footer.html'/]
[/#if]
</body>
</html>
[/#escape]
